<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        <title>EasyUI&nbsp;Demo&nbsp;-&nbsp;Pagination</title>
        <link rel="shortcut icon" href="../../assets/image/favicon.ico"/>
        <script type="text/javascript" src="../../assets/js/common.js"></script>
        <link rel="stylesheet" type="text/css" href="../../assets/libs/easyui/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="../../assets/libs/easyui/themes/icon.css">
        <script type="text/javascript" src="../../assets/libs/easyui/jquery.min.js"></script>
        <script type="text/javascript" src="../../assets/libs/easyui/jquery.easyui.min.js"></script>
    </head>
    <body>
        <h1>Pagination&nbsp;-&nbsp;Base&nbsp;基础组件</h1>
        <fieldset>
            <legend>使用案例</legend>
            <p>使用标签创建分页控件。</p>
            <div id="pp" class="easyui-pagination" data-options="total:2000,pageSize:10" style="background:#efefef;border:1px solid #ccc;"></div>
            <p>使用javascript创建分页。</p>
            <div id="pp1" style="background:#efefef;border:1px solid #ccc;"></div>
            <p>让我们使用面板和分页插件来创建一个ajax分页。当用户选择一个新页面的时候，面板将显示指定页面的内容。</p>
            <div id="content" class="easyui-panel" style="height:200px" data-options="href:'/pagination/showContent?page=1&pageSize=10'"></div>
            <div class="easyui-pagination" style="border:1px solid #ccc;" 
                data-options="
                    total: 2000,
                    pageSize: 10,
                    onSelectPage: function(pageNumber, pageSize) {
                        $('#content').panel('refresh', '/pagination/showContent?page='+pageNumber+'&pageSize=' + pageSize);
                    },
                    pageList: [10, 15, 20, 30, 50, 100, 200, 250, 500],
                    layout: ['list', 'sep', 'manual', 'refresh', 'first', 'prev', 'links', 'next', 'last', 'info'],
                    links: 5,
                    showPageList: true,
                    showRefresh: true,
                    showPageInfo: true,
                    beforePageText: '第',
                    afterPageText: '/ {pages}页',
                    displayMsg: '显示第{from}到{to}条，共{total}条数据',
                    onChangePageSize: function(pageSize) {
                        console.log('修改了分页大小：', pageSize);
                        $('#content').panel('refresh', '/pagination/showContent?page=1&pageSize='+pageSize);
                    }">
            </div>
        </fieldset>
    </body>
    <script type="text/javascript">
        $('#pp1').pagination({
            total: 2000,
            pageSize: 10
        });
    </script>
</html>